﻿using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace Toybox.NicoSharp.Live.UnitTest
{
	using LiveGuide;

	[TestClass]
	public class Test_Live_LiveGuide : AbstractTester
	{
		[TestMethod]
		public void Test_ZeroStreamList()
		{
			ZeroStreamList list = ZeroStreamList.Get(GetStreamMode.comingsoon, 1);
			Assert.IsNotNull(list);

			list = ZeroStreamList.Get(GetStreamMode.closed, 1);
			Assert.IsNotNull(list);
		}

		[TestMethod]
		public void Test_WatchingReservation()
		{
			WatchingReservation.ListResult result = WatchingReservation.GetList();
			Assert.IsNotNull(result);

			string id = "155390985";
			string key = WatchingReservation.GetWatchNum(id);
			Assert.IsNotNull(key);

			bool regist = WatchingReservation.PostRegist(id, key);
			Assert.IsTrue(regist);
		}

		[TestMethod]
		public void Test_ZeroTimeLine()
		{
			ZeroTimeLine tl = ZeroTimeLine.Get(DateTime.Now);
			Assert.IsNotNull(tl);
		}

		[TestMethod]
		public void Test_ZappingList()
		{
			ZappingList list = ZappingList.Get(ZRouteType.index);
			Assert.IsNotNull(list);

			list = ZappingList.GetRecent(LiveTabType.All, LiveSortType.start_time, true, null);
			Assert.IsNotNull(list);

			list = ZappingList.GetRecent(LiveTabType.Try, LiveSortType.view_counter, false, "マイクラ マインクラフト");
			Assert.IsNotNull(list);

			list = ZappingList.GetSearch("テスト", null);
			Assert.IsNotNull(list);
		}
	}
}
